<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>Class List</title>
</head>
<body>
<h2>Class List</h2>

<table>
  <thead>
  <tr>
    <th>Class ID</th>
    <th>Class Name</th>
    <th>Grade</th>
    <th>Class Teacher</th>
    <!-- 可以根据实际需求添加更多列 -->
    <th>Actions</th>
  </tr>
  </thead>
  <tbody>
  <!-- 使用Thymeleaf迭代显示班级信息 -->
  <tr th:each="classInfo : ${classList}">
    <td th:text="${classInfo.classId}">Class ID</td>
    <td th:text="${classInfo.className}">Class Name</td>
    <td th:text="${classInfo.grade}">Grade</td>
    <td th:text="${classInfo.classTeacher}">Class Teacher</td>
    <!-- 可以根据实际需求添加更多列 -->
    <td>
      <!-- 添加操作按钮，比如修改和删除 -->
      <a th:href="@{'/admin/updateClass/' + ${classInfo.classId}}">Update</a>
      <a th:href="@{'/admin/deleteClass/' + ${classInfo.classId}}" onclick="return confirm('Are you sure?')">Delete</a>
    </td>
  </tr>
  </tbody>
</table>
</body>
</html>
